<template>
	<el-dialog :title="dataForm.id?'修改':'新增'" :visible.sync="dialogVisible" :before-close="handleClose" width="640px">

		<el-form :model="dataForm" size="small" :rules="rules" ref="dataForm" label-width="150px" class="demo-ruleForm">
			<el-form-item label="登录账号" prop="name">
				<el-input v-model="dataForm.name" placeholder="账号由字母或数字组成"></el-input>
			</el-form-item>
			<el-form-item label="登录密码" prop="name">
				<el-input v-model="dataForm.name" placeholder="请输入登录密码"></el-input>
			</el-form-item>
			<el-form-item label="确认密码" prop="name">
				<el-input v-model="dataForm.name" placeholder="请再次输入密码"></el-input>
			</el-form-item>
			<div class="hr_xian"></div>
			<el-form-item label="工厂名称" prop="name">
				<el-input v-model="dataForm.name" placeholder="请输入工厂名称"></el-input>
			</el-form-item>
			<el-form-item label="工厂实际住所" prop="name">
				<el-input v-model="dataForm.name" placeholder="请输入工厂实际住所"></el-input>
			</el-form-item>
			<el-form-item label="联系人" prop="name">
				<el-input v-model="dataForm.name" placeholder="请输入联系人"></el-input>
			</el-form-item>
			<el-form-item label="联系电话" prop="name">
				<el-input v-model="dataForm.name" placeholder="请输入联系电话"></el-input>
			</el-form-item>
			<el-form-item label="状态" prop="name">
			 <el-radio v-model="dataForm.name" label="1">正常</el-radio>
			  <el-radio v-model="dataForm.name" label="2">禁用</el-radio>
			</el-form-item>
			<div class="hr_xian"></div>
			<el-form-item label="备注信息" prop="name">
				<el-input type="textarea" v-model="dataForm.desc"></el-input>
			</el-form-item>
		</el-form>
		<span slot="footer" class="dialog-footer">
			<el-button @click="dialogVisible = false" size="small">取 消</el-button>
			<el-button type="primary" size="small" @click="dialogVisible = false">确 定</el-button>
		</span>
	</el-dialog>
</template>

<script>
	import debounce from 'lodash/debounce'
	import {
		pcaTextArr
	} from "element-china-area-data"
	export default {
		data() {
			return {
				pcaTextArr,
				dialogVisible: false,
				dataForm: {
					id: '',
				},
				rules: {
					name: [{
						required: true,
						message: '请选择活动区域',
						trigger: 'change'
					}]
				}
			}
		},
		methods: {
			init() {
				this.dialogVisible = true
				this.$nextTick(() => {

				})
			},
			submitForm(formName) {
				this.$refs[formName].validate((valid) => {
					if (valid) {
						alert('submit!');
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			resetForm(formName) {
				this.$refs[formName].resetFields();
			},
			handleClose() {
				this.dialogVisible = false
			}
		}
	}
</script>
<style scoped lang="scss">
	.demo-ruleForm {
		padding-right: 50px;
	}
</style>